//
// Created by xili on 2024/8/3 16:43.
// Go big or go home.
//
#include <vector>
#include <climits>

using namespace std;

class Solution {
public:
    int findGCD(vector<int> &nums) {
        int mx = 0, mn = INT_MAX;
        for (auto &item: nums) {
            mx = max(mx, item);
            mn = min(mn, item);
        }
        return gcd(mx, mn);
    }

    int gcd(int a, int b) {
        return b == 0 ? a : gcd(b, a % b);
    }
};